import request from '@/utils/request'

// 查询硬件设备
export function queryDeviceInfo() {
    return request({
        url: '/devopscontroller/queryDeviceInfo',
        method: 'post'
    })
}

// 查询软件
export function querySoftwareInfo() {
    return request({
        url: '/devopscontroller/querySoftwareInfo',
        method: 'post',
    })
}

// 查询历史报告
export function queryHistoryReports(hisReportVo) {
    return request({
        url: '/devopscontroller/queryHistoryReports',
        method: 'post',
        data: hisReportVo
    })
}

// 导出历史报告Excel
export function exportHisReports(hisReportVo) {
    return request({
        url: '/devopscontroller/exportHisReports',
        method: 'post',
        data: hisReportVo
    })
}

// 合规性检查
export function comcheck(checkVo) {
    return request({
        url: '/devopscontroller/comcheck',
        method: 'post',
        data: checkVo
    })
}

export function addIndexScript(checkVo) {
  return request({
    url: '/devopscontroller/insertIndexScript',
    method: 'post',
    data: checkVo
  })
}


// 查询合规检查模板
export function queryComTemplate(id,name) {
    return request({
        url: `/devopscontroller/queryComTemplate?id=${id}&name=${name}`,
        method: 'post',
    })
}

// 删除合规检查模板
export function deleteComTemplate(id) {
    return request({
        url: `/devopscontroller/deleteComTemplate?id=${id}`,
        method: 'post',
    })
}

// 更新合规检查模板
export function updateComTemplate(comtemplate) {
    return request({
        url: `/devopscontroller/updateComTemplate`,
        method: 'post',
        data: comtemplate
    })
}

// 新增合规检查模板
export function addComTemplate(comtemplate) {
    return request({
        url: `/devopscontroller/addComTemplate`,
        method: 'post',
        data: comtemplate
    })
}

// 启用合规检查模板
export function enableComTemplate(id) {
    return request({
        url: `/devopscontroller/enableComTemplate?id=${id}`,
        method: 'post',
    })
}

export function enableComTemplate2(id) {
  return request({
    url: `/devopscontroller/enableComTemplate2?id=${id}`,
    method: 'post',
  })
}

// 查询启用的合规检查模板
export function queryEnableComTemplate() {
    return request({
        url: `/devopscontroller/queryEnableComTemplate`,
        method: 'post',
    })
}

// 查询合规检查模板
export function queryComModule(id,name) {
    return request({
        url: `/devopscontroller/queryComModule?id=${id}&name=${name}`,
        method: 'post',
    })
}

// 删除合规检查模快
export function deleteComModule(id) {
    return request({
        url: `/devopscontroller/deleteComModule?id=${id}`,
        method: 'post',
    })
}

// 更新合规检查模快
export function updateComModule(comModule) {
    return request({
        url: `/devopscontroller/updateComModule`,
        method: 'post',
        data: comModule
    })
}

// 新增合规检查模快
export function addComModule(comModule) {
    return request({
        url: `/devopscontroller/addComModule`,
        method: 'post',
        data: comModule
    })
}

// 新增历史
export function insertHistoryReports(his) {
  return request({
    url: `/devopscontroller/insertHistoryReports`,
    method: 'post',
    data: his
  })
}

// 查询检查项
export function queryCheckDep(id,name,isadmin) {
    return request({
        url: `/devopscontroller/queryCheckDep?id=${id}&name=${name}&isadmin=${isadmin}`,
        method: 'post',
    })
}

// 删除检查项
export function deleteCheckDep(id) {
    return request({
        url: `/devopscontroller/deleteCheckDep?id=${id}`,
        method: 'post',
    })
}

// 更新检查项
export function updateCheckDep(checkDep) {
    return request({
        url: `/devopscontroller/updateCheckDep`,
        method: 'post',
        data: checkDep
    })
}

// 新增合规检查模快
export function addCheckDep(checkDep) {
    return request({
        url: `/devopscontroller/addCheckDep`,
        method: 'post',
        data: checkDep
    })
}

// 审核检查项
export function checkCheckDep(id) {
    return request({
        url: `/devopscontroller/checkCheckDep?id=${id}`,
        method: 'post',
    })
}

// 查询漏洞
export function queryHole() {
    return request({
        url: `/devopscontroller/queryHole`,
        method: 'post',
    })
}

// 扫描漏洞
export function searchHole() {
    return request({
        url: `/devopscontroller/searchHole`,
        method: 'post',
    })
}

// 查询指标采集脚本
export function queryIndexScript(id,stat) {
    return request({
        url: `/devopscontroller/queryIndexScript?id=${id}&stat=${stat}`,
        method: 'post',
    })
}

// 审核指标采集脚本
export function checkIndexScript(id) {
    return request({
        url: `/devopscontroller/checkIndexScript?id=${id}`,
        method: 'post',
    })
}


export function addHistory(comtemplate) {
    return request({
        url: `/devopscontroller/addHistory`,
        method: 'post',
        data: comtemplate
    })
}